#include "../Base/stdafx.h"
#include "Time.h"

Time* Time::m_Singleton = NULL;

Time* Time::GetSingleton()
{
	if(m_Singleton == 0)
		m_Singleton = new Time();
	return m_Singleton;
}

void Time::Destroy()
{
	if(m_Singleton != 0)
		delete m_Singleton;
}

Time::Time()
{
	m_StartTime = second_clock::local_time();
}

Time::~Time()
{

}

tstring Time::GetTime()
{
	return to_simple_wstring(second_clock::local_time());
}

ptime Time::GetPTime() const
{
	return second_clock::local_time();
}

tstring Time::GetStartTime()
{
	return to_simple_wstring(m_StartTime);
}

const ptime& Time::GetStartPTime() const
{
	return m_StartTime;
}